package com.ruoyi.busi.guide.service.impl;

import com.ruoyi.busi.guide.domain.Message;
import com.ruoyi.busi.guide.mapper.MessageMapper;
import com.ruoyi.busi.guide.service.IMessageService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * 沟通记录Service业务层处理
 */
@Service
public class MessageServiceImpl implements IMessageService {

    @Autowired
    private MessageMapper messageMapper;

    public List<Message> selectByMentorId(Long mentorId) {
        return messageMapper.selectByMentorId(mentorId);
    }

    public List<Message> selectBySender(String sender) {
        return messageMapper.selectBySender(sender);
    }

    public boolean deleteMessageByIds(List<Long> messageIds) {
        return messageMapper.deleteMessagesByIds(messageIds) > 0;
    }

    @Override
    public boolean save(Message message) {
        return messageMapper.insert(message) > 0;
    }

    @Override
    public boolean updateById(Message message) {
        return messageMapper.updateById(message) > 0;
    }
}
